]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
automountManager: Fix password not re-asked for TCRYPT devices
authorsegfault <segfault@riseup.net>
Fri, 3 May 2024 11:50:58 +0000 (13:50 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 21 May 2024 12:32:38 +0000 (12:32 +0000)
Since commit

  https://gitlab.com/cryptsetup/cryptsetup/-/commit/f881092bbc92c79b3217d5e14e96f773f2460035

released in cryptsetup 2.5.0, cryptsetup returns EPERM instead of EINVAL
when the TCRYPT header can't be decrypted with the provided
password and parameters.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7631
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3300>

js/ui/components/automountManager.js

index 899c6a0d8f4c8c1a4dfbc2adfc4fec5c56d09d3c..4eee7c9d7c4d6b2b33309660e372496c6e936078 100644 (file)
@@ -199,8 +199,11 @@ class AutomountManager {
                 e.message.includes('No key available to unlock device') ||     // udisks (no password)
                 // libblockdev wrong password opening LUKS device
                 e.message.includes('Failed to activate device: Incorrect passphrase') ||
-                // cryptsetup returns EINVAL in many cases, including wrong TCRYPT password/parameters
-                e.message.includes('Failed to load device\'s parameters: Invalid argument')) {
+                // cryptsetup returns EINVAL (< v2.5.0) or EPERM (>= v2.5.0)
+                // when the TCRYPT header can't be decrypted with the provided
+                // password/parameters.
+                e.message.includes('Failed to load device\'s parameters: Invalid argument') ||
+                e.message.includes('Failed to load device\'s parameters: Operation not permitted')) {
                 this._reaskPassword(volume);
             } else {
                 if (e.message.includes('Compiled against a version of libcryptsetup that does not support the VeraCrypt PIM setting')) {